package com.regent.central.bill.repository.mrp;

import com.regent.central.bill.core.mrp.BillMaterialPurchaseSku;
import com.regent.central.bill.repository.mrp.dto.BillPurchaseArriveStatusQTO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.math.BigDecimal;

@Repository
public interface BillMaterialPurchaseSkuMapper extends Mapper<BillMaterialPurchaseSku> {

    int setArriveStatus(@Param("arriveStatus") Integer arriveStatus,
                        @Param("billMaterialPurchaseId") String billMaterialPurchaseId,
                        @Param("facMissionId") String facMissionId,
                        @Param("commonMaterialsSkuId") String commonMaterialsSkuId,
                        @Param("dateChangeType") int dateChangeType);

    int setQuantityArrive(@Param("quantityArrive") BigDecimal quantityArrive,
                          @Param("billMaterialPurchaseId") String billMaterialPurchaseId,
                          @Param("facMissionId") String facMissionId,
                          @Param("commonMaterialsSkuId") String commonMaterialsSkuId);

    int setArriveStatusSystem(@Param("arriveStatus") Integer arriveStatus,
                              @Param("billMaterialPurchaseId") String billMaterialPurchaseId,
                              @Param("facMissionId") String facMissionId,
                              @Param("commonMaterialsSkuId") String commonMaterialsSkuId);

    BillPurchaseArriveStatusQTO getArriveStatusByBillPurchase(String billMaterialPurchaseId);

    int undo(@Param("billMaterialPurchaseId") String billMaterialPurchaseId,
             @Param("arriveSatus") int arriveSatus);
}